// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   BasicServerConfig.java

package org.quickserver.util.xmlreader;

import java.io.Serializable;
import org.quickserver.net.server.*;

// Referenced classes of package org.quickserver.util.xmlreader:
//            ObjectPoolConfig, Secure, ServerMode, AdvancedSettings, 
//            DefaultDataMode, AccessConstraintConfig, ServerHooks

public class BasicServerConfig
    implements Serializable
{

    public BasicServerConfig()
    {
        name = null;
        maxConnectionMsg = "-ERR Server Busy. Max Connection Reached";
        timeoutMsg = "-ERR Timeout";
        maxAuthTry = 5;
        maxAuthTryMsg = "-ERR Max Auth Try Reached";
        port = 9876;
        maxConnection = -1L;
        timeout = 60000;
        consoleLoggingLevel = "INFO";
        objectPoolConfig = new ObjectPoolConfig();
        communicationLogging = false;
        secure = new Secure();
        serverMode = new ServerMode();
        advancedSettings = new AdvancedSettings();
        defaultDataMode = new DefaultDataMode();
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        if(name != null && !name.equals(""))
            this.name = name;
    }

    public String getServerBanner()
    {
        return serverBanner;
    }

    public void setServerBanner(String banner)
    {
        if(banner != null && !banner.equals(""))
            serverBanner = banner;
    }

    public void setPort(int port)
    {
        if(port >= 0)
            this.port = port;
    }

    public int getPort()
    {
        return port;
    }

    public void setClientCommandHandler(String handler)
    {
        if(handler != null && !handler.equals(""))
            clientCommandHandler = handler;
    }

    public void setClientCommandHandler(ClientCommandHandler handler)
    {
        if(handler != null)
            clientCommandHandler = handler.getClass().getName();
    }

    public String getClientCommandHandler()
    {
        return clientCommandHandler;
    }

    public void setClientEventHandler(String handler)
    {
        if(handler != null && !handler.equals(""))
            clientEventHandler = handler;
    }

    public void setClientEventHandler(ClientEventHandler handler)
    {
        if(handler != null)
            clientEventHandler = handler.getClass().getName();
    }

    public String getClientEventHandler()
    {
        return clientEventHandler;
    }

    public void setClientExtendedEventHandler(String handler)
    {
        if(handler != null && !handler.equals(""))
            clientExtendedEventHandler = handler;
    }

    public void setClientExtendedEventHandler(ClientExtendedEventHandler handler)
    {
        if(handler != null)
            clientExtendedEventHandler = handler.getClass().getName();
    }

    public String getClientExtendedEventHandler()
    {
        return clientExtendedEventHandler;
    }

    public void setAuthenticator(String authenticator)
    {
        if(authenticator != null && !authenticator.equals(""))
            clientAuthenticationHandler = authenticator;
    }

    public void setAuthenticator(Authenticator authenticator)
    {
        if(authenticator != null)
            clientAuthenticationHandler = authenticator.getClass().getName();
    }

    public String getAuthenticator()
    {
        return clientAuthenticationHandler;
    }

    public void setClientAuthenticationHandler(String clientAuthenticationHandler)
    {
        if(clientAuthenticationHandler != null && !clientAuthenticationHandler.equals(""))
            this.clientAuthenticationHandler = clientAuthenticationHandler;
    }

    public void setClientAuthenticationHandler(ClientAuthenticationHandler clientAuthenticationHandler)
    {
        if(clientAuthenticationHandler != null)
            this.clientAuthenticationHandler = clientAuthenticationHandler.getClass().getName();
    }

    public String getClientAuthenticationHandler()
    {
        return clientAuthenticationHandler;
    }

    public void setClientData(String data)
    {
        if(data != null && !data.equals(""))
            clientData = data;
    }

    public void setClientData(ClientData data)
    {
        if(data != null)
            clientData = data.getClass().getName();
    }

    public String getClientData()
    {
        return clientData;
    }

    public void setTimeout(int time)
    {
        timeout = time;
    }

    public int getTimeout()
    {
        return timeout;
    }

    public void setMaxAuthTry(int authTry)
    {
        maxAuthTry = authTry;
    }

    public int getMaxAuthTry()
    {
        return maxAuthTry;
    }

    public void setMaxAuthTryMsg(String msg)
    {
        if(msg != null && !msg.equals(""))
            maxAuthTryMsg = msg;
    }

    public String getMaxAuthTryMsg()
    {
        return maxAuthTryMsg;
    }

    public void setTimeoutMsg(String msg)
    {
        if(msg != null && !msg.equals(""))
            timeoutMsg = msg;
    }

    public String getTimeoutMsg()
    {
        return timeoutMsg;
    }

    public void setMaxConnection(long maxConnection)
    {
        this.maxConnection = maxConnection;
    }

    public long getMaxConnection()
    {
        return maxConnection;
    }

    public void setMaxConnectionMsg(String maxConnectionMsg)
    {
        if(maxConnectionMsg != null && !maxConnectionMsg.equals(""))
            this.maxConnectionMsg = maxConnectionMsg;
    }

    public String getMaxConnectionMsg()
    {
        return maxConnectionMsg;
    }

    public void setBindAddr(String bindAddr)
    {
        if(bindAddr != null && !bindAddr.equals(""))
            this.bindAddr = bindAddr;
    }

    public String getBindAddr()
    {
        return bindAddr;
    }

    public void setClientObjectHandler(String handler)
    {
        if(handler != null && !handler.equals(""))
            clientObjectHandler = handler;
    }

    public void setClientObjectHandler(ClientObjectHandler handler)
    {
        if(handler != null)
            clientObjectHandler = handler.getClass().getName();
    }

    public String getClientObjectHandler()
    {
        return clientObjectHandler;
    }

    public void setConsoleLoggingLevel(String level)
    {
        if(level != null && !level.equals(""))
            consoleLoggingLevel = level;
    }

    public String getConsoleLoggingLevel()
    {
        return consoleLoggingLevel;
    }

    public void setConsoleLoggingFormatter(String formatter)
    {
        if(formatter != null && !formatter.equals(""))
            consoleLoggingFormatter = formatter;
    }

    public String getConsoleLoggingFormatter()
    {
        return consoleLoggingFormatter;
    }

    public void setObjectPoolConfig(ObjectPoolConfig objectPoolConfig)
    {
        if(objectPoolConfig != null)
            this.objectPoolConfig = objectPoolConfig;
    }

    public ObjectPoolConfig getObjectPoolConfig()
    {
        return objectPoolConfig;
    }

    public void setCommunicationLogging(boolean enable)
    {
        communicationLogging = enable;
    }

    public boolean getCommunicationLogging()
    {
        return communicationLogging;
    }

    public void setAccessConstraintConfig(AccessConstraintConfig accessConstraintConfig)
    {
        this.accessConstraintConfig = accessConstraintConfig;
    }

    public AccessConstraintConfig getAccessConstraintConfig()
    {
        return accessConstraintConfig;
    }

    public void setServerHooks(ServerHooks serverHooks)
    {
        this.serverHooks = serverHooks;
    }

    public ServerHooks getServerHooks()
    {
        return serverHooks;
    }

    public void setSecure(Secure secure)
    {
        this.secure = secure;
    }

    public Secure getSecure()
    {
        return secure;
    }

    public void setClientBinaryHandler(String handler)
    {
        if(handler != null && !handler.equals(""))
            clientBinaryHandler = handler;
    }

    public void setClientBinaryHandler(ClientBinaryHandler handler)
    {
        if(handler != null)
            clientBinaryHandler = handler.getClass().getName();
    }

    public String getClientBinaryHandler()
    {
        return clientBinaryHandler;
    }

    public void setServerMode(ServerMode serverMode)
    {
        if(serverMode == null)
            serverMode = new ServerMode();
        this.serverMode = serverMode;
    }

    public ServerMode getServerMode()
    {
        return serverMode;
    }

    public void setClientWriteHandler(String handler)
    {
        if(handler != null && !handler.equals(""))
            clientWriteHandler = handler;
    }

    public void setClientWriteHandler(ClientWriteHandler handler)
    {
        if(handler != null)
            clientWriteHandler = handler.getClass().getName();
    }

    public String getClientWriteHandler()
    {
        return clientWriteHandler;
    }

    public void setAdvancedSettings(AdvancedSettings advancedSettings)
    {
        this.advancedSettings = advancedSettings;
    }

    public AdvancedSettings getAdvancedSettings()
    {
        if(advancedSettings == null)
            advancedSettings = new AdvancedSettings();
        return advancedSettings;
    }

    public void setDefaultDataMode(DefaultDataMode defaultDataMode)
    {
        this.defaultDataMode = defaultDataMode;
    }

    public DefaultDataMode getDefaultDataMode()
    {
        if(defaultDataMode == null)
            defaultDataMode = new DefaultDataMode();
        return defaultDataMode;
    }

    private String clientAuthenticationHandler;
    private String clientEventHandler;
    private String clientExtendedEventHandler;
    private String clientCommandHandler;
    private String clientObjectHandler;
    private String clientBinaryHandler;
    private String clientData;
    private String clientWriteHandler;
    private String serverBanner;
    private String name;
    private String maxConnectionMsg;
    private String timeoutMsg;
    private int maxAuthTry;
    private String maxAuthTryMsg;
    private int port;
    private String bindAddr;
    private long maxConnection;
    private int timeout;
    private String consoleLoggingLevel;
    private String consoleLoggingFormatter;
    private ObjectPoolConfig objectPoolConfig;
    private boolean communicationLogging;
    private AccessConstraintConfig accessConstraintConfig;
    private ServerHooks serverHooks;
    private Secure secure;
    private ServerMode serverMode;
    private AdvancedSettings advancedSettings;
    private DefaultDataMode defaultDataMode;
}
